<% unless @project.milestones.size > 0 %>
	
	<div class="alert green center">
		<h1><%= link_to "Create a new milestone", new_project_milestone_path(@project) %></h1>
		<p>Não há nenhuma etapa cadastrada ainda, crie uma agora mesmo!</p>
	</div>
	
<% else %>

<% title t(:milestone, :count => @scheduled.size) %>

<%= render :partial => "table", :locals => {:label => t(:late, :count => @late.size, :scope => [:milestone, :status]),
											:table_class => "red",
											:description_class => "font-size-large font red rounded-4",
											:milestones => @late} if @late.size > 0 %>

<%= render :partial => "table", :locals => {:label => t(:pending, :count => @scheduled.size, :scope => [:milestone, :status]),
											:milestones => @scheduled} if @scheduled.size > 0 %>
											
<%= render :partial => "table", :locals => {:label => t(:completed, :count => @completed.size, :scope => [:milestone, :status]),
											:table_class => "green",
											:milestones => @completed} if @completed.size > 0 %>
											
<%= render :partial => "table", :locals => {:label => t(:unscheduled, :count => @unscheduled.size, :scope => [:milestone, :status]),
											:table_class => "gray",
											:milestones => @unscheduled} if @unscheduled.size > 0 %>

<% end %>

<% content_for(:subtabs) do %>
	<%= render "milestones/navigation/index_subtabs" %>
<% end %>



<% content_for :sidebar do %>
	<p class="center"><%= link_to t(:new, :scope => :milestone), new_project_milestone_path, :class => 'awesome large', :style => 'font-size: 18px' %></p>
	
	<% @upcoming.sort_by(&:first).each do |month, milestones| %>
	
		<p class="title lightest rounded-4"><%= t(:month_names, :scope => :date)[month.strftime("%m").to_i] %></p>
		
		<dl class="icon-list">
		<% milestones.each do |milestone| %>
			<dt class="icon <%= milestone.late? ? 'bullet-red' : 'bullet-blue' %>"><%= link_to milestone.title, project_milestone_path(@project, milestone) %></dt>
			<dd><small><%= t :due %>: <%= l milestone.due, :format => :long %></small> <%= '<small class="font red"><b>(late)</b></small>' if milestone.late? %></dd>
		<% end %>
		</dl>
	<% end %>
<% end %>